From: Jonas Dreßler Date: Thu, 31 Oct 2019 23:19:38 +0000 (+0100) Subject: appDisplay: Use _getCategories function instead of duplicating the code X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~329 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c4fa052b033c954b77c969aa9caf42cebd3ebd47;p=gnome-shell.git appDisplay: Use _getCategories function instead of duplicating the code We already have a function which gets the categories of an app and handles the null-return case, use it. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/799 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 3b70cd5c0..8960f6fa8 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -102,10 +102,7 @@ function _findBestFolderName(apps) { let commonCategories = []; appInfos.reduce((categories, appInfo) => { - const appCategories = appInfo.get_categories(); - if (!appCategories) - return categories; - for (let category of appCategories.split(';')) { + for (let category of _getCategories(appInfo)) { if (!(category in categoryCounter)) categoryCounter[category] = 0;